package com.zjc.controller;

import com.zjc.common.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/api")
public class logoutController {
	@PostMapping("/logout")
	public R<String> logout(HttpServletRequest request){
		//清理session
		request.removeAttribute("user");
		return R.success("退出成功！");
	}
}
